{% block oro_type_text_filter_js %}
    new (ChoiceFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.type.vars.choices|oro_filter_choices|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_number_filter_js %}
    new (NumberFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.type.vars.choices|oro_filter_choices|json_encode|raw }},
        'formatterOptions': {{ formView.vars.formatter_options|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_date_range_filter_js %}
    new (DateFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.type.vars.choices|oro_filter_choices|json_encode|raw }},
        'typeValues': {{ formView.vars.type_values|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_datetime_range_filter_js %}
    new (DatetimeFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.type.vars.choices|oro_filter_choices|json_encode|raw }},
        'typeValues': {{ formView.vars.type_values|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_select_filter_js %}
    new (SelectFilter.extend({
        'name':             {{ formView.vars.name|json_encode|raw }},
        'label':            {{ formView.vars.label|json_encode|raw }},
        'enabled':          {{ formView.vars.show_filter|json_encode|raw }},
        'populateDefault':  {{ formView.vars.populate_default|json_encode|raw }},
        'choices':          {{ formView.children.value.vars.choices|oro_filter_choices|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_selectrow_filter_js %}
    new (SelectRowFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.value.vars.choices|oro_filter_choices|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_multiselect_filter_js %}
    new (MultiSelectFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.value.vars.choices|oro_filter_choices|json_encode|raw }}
    }))
{% endblock %}

{% block oro_type_choice_filter_js %}
    {% if formView.children.value.vars.multiple %}
        {{ block('oro_type_multiselect_filter_js') }}
    {% else %}
        {{ block('oro_type_select_filter_js') }}
    {% endif %}
{% endblock %}

{% block oro_type_entity_filter_js %}
    {{ block('oro_type_choice_filter_js') }}
{% endblock %}

{% block oro_type_boolean_filter_js %}
    new (SelectFilter.extend({
        'name':    {{ formView.vars.name|json_encode|raw }},
        'label':   {{ formView.vars.label|json_encode|raw }},
        'enabled': {{ formView.vars.show_filter|json_encode|raw }},
        'choices': {{ formView.children.value.vars.choices|oro_filter_choices|json_encode|raw }},
        'contextSearch': false
    }))
{% endblock %}
